import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"
import { IsNotEmpty, IsNumber, IsNumberString, IsOptional, IsString } from "class-validator"

export class UpdateMenuDto {
  @ApiProperty({ description: '', required: true, default: '' })
  @IsNotEmpty({ message: '菜品id必填' })
  readonly id: number

  @ApiPropertyOptional({ description: '菜品名称', required: false, default: '' })
  @IsOptional() // 可选字段
  @IsString()
  readonly name?: string

  @ApiPropertyOptional({ description: '菜品价格', type: String, required: false, default: '' })
  @IsOptional()
  @IsNumberString()
  readonly fee?: string

  @ApiPropertyOptional({ description: '菜品类型', required: false, default: '' })
  @IsOptional()
  // @IsNumber()
  readonly type?: number

  @ApiPropertyOptional({ description: '菜品图片', required: false, default: '' })
  @IsOptional()
  readonly photo_url?: string

  update_time?: number

  @ApiPropertyOptional({ description: '菜品描述', required: false, default: '' })
  @IsOptional()
  readonly description?: string

  @ApiPropertyOptional({ description: '菜品配料', required: false, default: '' })
  @IsOptional()
  readonly ingredients?: string
}